package nc.ui.mmpps.plo.action.busi;

import java.awt.event.ActionEvent;
import nc.ui.mmf.framework.action.ActionInitializer;
import nc.ui.mmf.framework.batch.BatchProcessAction;
import nc.ui.mmpps.plo.action.PLOActionRegistry;
import nc.ui.mmpps.plo.action.util.PoActionsUtil;
import nc.ui.uif2.actions.ActionInfo;
import nc.vo.mmpps.mpm.res.MpmRes;
import nc.vo.mmpps.mps0202.BillstatusEnum;

public class PloConfirmAction extends BatchProcessAction {
	private static final long serialVersionUID = -729647395317395274L;

	public PloConfirmAction() {
		ActionInfo info = PLOActionRegistry.getActionInfo("PloConfirmAction");
		ActionInitializer.initializeAction(this, info.getCode(),info.getName(), info.getShort_description(),info.getKeyStroke());

		putValue("PloConfirmAction", MpmRes.BTN_CONFIRM());
	}

	public void doAction(ActionEvent e) throws Exception {
		super.doAction(e);
	}

	protected boolean isActionEnable() {
		if (!super.isActionEnable()) {
			return false;
		}

		Object[] objs = getBatchProcessor().getModel().getSelectedOperaDatas();

		return PoActionsUtil.isActionEnable(objs,BillstatusEnum.PLAN.intValue(), getBatchProcessor().getModel());
	}
}
